/*
 ============================================================================
 Name        : YuebaoTaskManagerCanvas
 Author      :
 Version     :
 Copyright   : Your copyright notice
 Description :
 ============================================================================
 */

#ifndef YuebaoTaskManagerCanvas_H
#define YuebaoTaskManagerCanvas_H

// INCLUDES
#include <e32std.h>
#include "fCanvas.h"
#include "YuebaoCanvasTemplate.h"
#include "fToolbar.h"
#include "fListbox.h"
#include "HttpEngine.h"
#include <e32cmn.h>
#include "fImage.h"
#include "YuebaoDownloadTaskManager.h"
#include "YuebaoLabel.h"

class YuebaoCanvasManager;
class CResponseSearch;

class YuebaoTaskManagerCanvas : public fCanvas, public YuebaoDownloadTaskManagerObserver, public MDialogEventObserver
{
public:
    static YuebaoTaskManagerCanvas* NewLC( fEngine* aFramework, MCanvasManager* aManager, int canvasID );
    static YuebaoTaskManagerCanvas* NewL( fEngine* aFramework, MCanvasManager* aManager, int canvasID );
    virtual ~YuebaoTaskManagerCanvas( );
protected:
    void ConstructL( fEngine* aFramework );
    YuebaoTaskManagerCanvas( MCanvasManager* aManager, int canvasID );

protected:
    void RenderFrame( );
    void HandleKey( f_KEY_DES* aKeyDes );
    TInt HandleMouse( fMouseEvent /*nType*/, TPoint /*sPoint*/ );
protected:
    void SwitchToCanvas( const TDesC& aCommandline, void* data );
    void SwitchFromCanvas( );
    void SwitchBack( );
protected:
    fListbox* _listBox;
    //fLabel* _label;
    YuebaoCanvasTemplate* _canvasStyle;
    fToolbar* iCommandBar;
    RPointerArray< fImage > _icons;
protected:
    bool _focusInHeader;
protected:
    CFont* _font;
protected:
    void ReloadListbox( );
protected:
    void TaskRemoved( YuebaoDownloadTaskManager*, int index );
public:
    void HandleReturnEvent( fDialog* aObject, TReturnValue aValue );
};

#endif // YuebaoTaskManagerCanvas_H
